// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "AIController.h"
#include "SimpleAIController.generated.h"

/**
 * 
 */
UCLASS()
class SIMPLE_API ASimpleAIController : public AAIController
{
	GENERATED_BODY()
	
public:
	ASimpleAIController(const FObjectInitializer& ObjectInitializer);

	FORCEINLINE class UBlackboardComponent* GetBlackboardComp() const { return BlackboardComp; }
	FORCEINLINE class UBehaviorTreeComponent* GetBehaviorComp() const { return BehaviorComp; }

	virtual void UpdateControlRotation(float DeltaTime, bool bUpdatePawn = true) override;

	virtual void GameHasEnded(class AActor* EndGameFocus = nullptr, bool bIsWinner = false) override;

private:

	UPROPERTY(Transient)
	class UBlackboardComponent* BlackboardComp;

	UPROPERTY(Transient)
	class UBehaviorTreeComponent* BehaviorComp;

public:

	UFUNCTION(BlueprintCallable, Category = Simple)
	void ShootEnemy();

	virtual void Possess(class APawn* InPawn) override;

	virtual void UnPossess() override;

	void Respawn();

	void SetEnemy(class APawn* InPawn);

	class ASimpleCharacter* GetEnemy() const;

	void UpdateAI();

protected:

	int32 EnemyKeyID;
};
